package com.yueya.config;

import com.alicloud.openservices.tablestore.SyncClient;
import com.jfinal.kit.PropKit;

public class TableKit {
	/**
	 * 短信验证码表
	 */
	public static final String SMS_CODE = "sms_code_table";

	/**
	 * TOKEN表
	 */
	public static final String TOKEN = "account_token_table";

	/**
	 * 消息主表
	 */
	public static final String MSG = "msg_table";

	/**
	 * 消息关联表
	 */
	public static final String MSG_ACCOUNT = "msg_account_table";

	public static final String COLUMN_PK = "pk";// 主键
	public static final String COLUMN_EXPIRES = "expires"; // 过期时间

	static String endPoint = PropKit.use("aliyun_table_config.properties").get("aliyun.endpoint");
	static String accessId = PropKit.use("aliyun_table_config.properties").get("aliyun.accessid");
	static String accessKey = PropKit.use("aliyun_table_config.properties").get("aliyun.accesskey");
	static String instanceName = PropKit.use("aliyun_table_config.properties").get("aliyun.instancename");

	/**
	 * 获取阿里去TABLE STORE的client
	 * 
	 * @return
	 */
	public static SyncClient getClient() {
		return new SyncClient(endPoint, accessId, accessKey, instanceName);
	}
}
